//
//  NSString+Additions.h
//  IOSDuoduo
//
//  Created by xx on 14-5-23.
//  Copyright (c) 2014年 dujia. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface NSString (AdditionsString)

+(NSString *)documentPath;
+(NSString *)cachePath;
+(NSString *)formatCurDate;
+(NSString *)formatCurDay;
+(NSString *)getAppVer;
- (NSString*)removeAllSpace;
+(NSString *)formatCurDayForVersion;
- (BOOL)isAllSpaceCharacter;
- (NSURL *) toURL;
- (BOOL) isEmail;
- (BOOL) isEmpty;
- (NSString *) MD5;
-(NSString *)trim;
- (NSString *)telNumberFormat;

-(BOOL) isOlderVersionThan:(NSString*)otherVersion;
-(BOOL) isNewerVersionThan:(NSString*)otherVersion;

- (NSComparisonResult)chineseCompare:(NSString *)strToCompare;

/**
 *  截取URL中的参数
 *
 *  @return NSMutableDictionary parameters
 */
- (NSMutableDictionary *)getURLParameters;

/**
 *  是否以中文开头
 *
 *  @param str 需要判断的字符串
 *
 *  @return YES表示以中文开始
 */
+ (BOOL)startsWithChinese:(NSString *)str;

/**
 *  按 0 > a > 中 (拼音） > #$  的顺序排序
 *
 *  @param strToCompare 需要比较的字符串
 *
 *  @return 比较结果
 */
- (NSComparisonResult)ctalkCompare:(NSString *)strToCompare;

/**
 *  指定字符串出现的次数
 *
 *  @param searchString 需要判断的字符串
 *
 *  @return NSUInteger出现的次数
 */
- (NSInteger)countOccurencesOfString:(NSString*)searchString;



#pragma mark - 设置字体的大小／颜色 格式为： aa bb
+ (NSAttributedString *)setTitle:(NSString *)title titleColor:(UIColor *)titleColor titleFont:(UIFont *)titleFont value:(NSString *)value valueColor:(UIColor *)valueColor valueFont:(UIFont *)valueFont;

#pragma mark - 设置颜色, 格式为： aa bb
+ (NSAttributedString *)setTitle:(NSString *)title titleColor:(UIColor *)titleColor value:(NSString *)value valueColor:(UIColor *)valueColor;

#pragma mark - 设置颜色，格式为 aabb
+ (NSAttributedString *)setText:(NSString *)text forIndex:(NSIndexPath *)indexPath andColor:(UIColor *)valueColor;


@end
